import {
    ProColumnType,
    ProTableProps,
    RequestData,
} from '@ant-design/pro-table';
import { ProFormProps } from '@ant-design/pro-form';

export interface CollapseHeaderParams {
    collapse: boolean;
    setCollapse: React.Dispatch<React.SetStateAction<boolean>>;
}

export interface SearchAndTableProps<T, P> {
    columns: ProColumnType<T>[];
    otherColumns?: ProColumnType<T>[];
    request: (params: PageConfigParams & P) => Promise<RequestData<T>>;
    formProps?: ProFormProps;
    tableProps?: ProTableProps<T, P>;
    renderCollapseHeader: (params: CollapseHeaderParams) => React.ReactNode;
    renderController?: () => React.ReactNode;
}

export interface PageConfigParams {
    pageSize: number;
    current: number;
}
